sass: Migrate from deprecated @import to @use#1313
Open
nbogie wants to merge 1 commit intoprocessing:2.0from
Open
sass: Migrate from deprecated @import to @use#1313nbogie wants to merge 1 commit intoprocessing:2.0from
nbogie wants to merge 1 commit intoprocessing:2.0from
Conversation
a937b17 to
61865ef
Compare
Member
|
Full namespace is fine as it is not very significant. Let me know when you are ready with this one and I can check locally as well. |
61865ef to
de6b882
Compare
Also, assume project root dir is in load path, remove leading / However, see differences from @import https://sass-lang.com/documentation/at-rules/use/#differences-from-import Also, make import warnings fatal to catch regressions
de6b882 to
7aab99b
Compare
Contributor
Author
|
Hi @limzykenneth! I've tested this out and detailed the status and testing sections in the top body. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1309 , moving away from the deprecated
@importto@use.Changes:
@importto@usee.g.
/styles/variables.scsstostyles/variables.scss@import(an accidental regression) will break the build with appropriate message.Status:
Done, I think. Ready for review.
[x] dev and build work locally and look fine.
[x] deploys to cloudflare through the normal github actions: https://p5web-sass-fix-beta.neillzero.workers.dev/
[x] looks ok deployed this way
[x] I ran a comparison of generated css files before-and-after and found minimal differences (no additional css duplication, for example).
[x] No more deprecation warnings from this source in
npm run dev.Testing:
All CSS files in dist/ - before and after
Locally ran astro build with
npm run buildon the current 2.0 with and without the PR, and compared all generated.cssfiles.A main worry was that the new approach would add repeats of css sections, bloating downloads. No file size increase here is good to see.
However, I understand that astro can also inline css into html pages. So i tested the generated sizes of those next.
dist/ dir - before and after
All html files in dist/ - before and after
du(uses 512 byte blocks).CI including deployment
discussion (opinions)
While it's possible to rename the namespace when using
@use,So instead of:
We could write:
but I suggest sticking with the full namespace (in this case
variables) is less surprising, more self-descriptive, easier for find/find-replace, and not too long.(Anyway, that can be decided and changed going fwd.)